
#include <dlfcn.h>
#include "ka-system/types.h"
#include "ka-system/lib.h"

using namespace ka;

void *loadLibrary(const char *filePath) {
    return dlopen(filePath, RTLD_LAZY);
}

void *getLibrarySymbol(void *library, const char *symbolName) {
    void *sym = NULL;
    if (library) {
        sym = dlsym(library, symbolName);
    }
    return sym;
}

void closeLibrary(void *library) {
    if (library) {
        dlclose(library);
    }
}